$(function() {
    //showDealTask();
    //每五分钟查询一次
    //setInterval("showDealTask()", 1000*60*5);
});
//任务单成交提示
function showDealTask(){
    $.post(
        'shuntController.do?getTipDealTask',
        {},
        function(data){
            var d = $.parseJSON(data);
            if (d.success) {
                //tip(d.msg);
                $("#tips_small").html(d.msg);
                setTimeout("tips_pop()",3000);
            }
        }
    );
}
function tips_pop() {
    var MsgPop = document.getElementById("winpop");
    MsgPop.style.display = "none";//显示隐藏的窗口
    MsgPop.style.height = "0px";//显示隐藏的窗口
    MsgPop.style.display = "block";//显示隐藏的窗口
    show = setInterval("changeH('up')", 2);
}

function close_pop() {
    hide = setInterval("changeH('down')",2);
}

function changeH(str){
    var MsgPop=document.getElementById("winpop");
    var popH=parseInt(MsgPop.style.height);
    if(str=="up"){
        if(popH<=128){
            MsgPop.style.height=(popH+4).toString()+"px";
        }
        else{
            clearInterval(show);
        }
    }
    if(str=="down"){
        if(popH>=4){
            MsgPop.style.height=(popH-4).toString()+"px";
        }
        else{
            clearInterval(hide);
            MsgPop.style.display="none"; //隐藏DIV
        }
    }
}

function initPop(){
    var oclose=document.getElementById("close");
    var bt=document.getElementById("bt");
    document.getElementById('winpop').style.height='0px';
    //setTimeout("tips_pop()",3000);
    //oclose.onclick=function(){close_pop()};
    //bt.onclick=function(){tips_pop()};
    $("#close").click(function(){close_pop()});
    $("#bt").click(function(){tips_pop()});
}
window.onload=function(){
    initPop();
    //tips_pop();
};